#include "led.h"
#include "globalDevice.h"
#include "gd32f4xx_gpio.h"
#include "gd32f4xx_rcu.h"

/*!
    \brief      LED初始化
    \param[in]  none
    \param[out] none
    \retval     none
*/
void led_init(void)
{
}

/*!
    \brief      LED翻转
    \param[in]  none
    \param[out] none
    \retval     none
*/
void led_toggle(device_enum_t led)
{
    if (led >= DEVICE_PIN_MAX)
    {
        return;
    }

    HAL_BIT_TOGGLE(led);
}
/*!
    \brief      LED点亮
    \param[in]  none
    \param[out] none
    \retval     none
*/
void led_on(device_enum_t led)
{
    if (led >= DEVICE_PIN_MAX)
    {
        return;
    }
    HAL_BIT_SET(led);
}

/*!
    \brief      LED熄灭
    \param[in]  none
    \param[out] none
    \retval     none
*/
void led_off(device_enum_t led)
{
    if (led >= DEVICE_PIN_MAX)
    {
        return;
    }
    HAL_BIT_RESET(led);
}